﻿using OpenAiMobile.Util.GZip;

namespace OpenAiMobile.Tools
{
    internal static class Constants
    {
        // ReSharper disable once InconsistentNaming
        public static class SQLite
        {
            //SQLite数据库文件名
            // ReSharper disable once InconsistentNaming
            private static string FileName => "database.db3";

            //SQLite数据库密码
            // ReSharper disable once InconsistentNaming
            private static string Password => "";

            //SQLite连接字符串
            public static string ConnectionString => $"Filename={FileName};Password={Password}";

            //获取SQLite连接字符串(指定路径)
            public static string GetConnectionString(string path)
            {
                var fileName = Path.Combine(path, FileName);
                return $"Filename={fileName}";
            }
        }

        public static class ConfigKeys
        {
            public static readonly string AccountId = "AccountId";
            public static readonly string AesKey = "AesKey";
            public static readonly string ApiKey = "ApiKey";
            public static readonly string ServerIp = "ServerIp";
            public static readonly string ServerPort = "ServerPort";
            public static readonly string RequestTimeout = "RequestTimeout";
        }

        public static class ConfigValues
        {
            public static string AesKey
            {
                get
                {
                    var content = "H4sIAAAAAAAACjMwNTJOMjQ2MjNKMjRKNjI0TbEwMLC0NLZIM002NEkzBAAHYHBgIAAAAA==";
                    return GZipHelper.GZipDecompressString(content);
                }
            }

            public static readonly string ApiKey = "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";
            public static readonly string ServerIp = "47.93.125.130";
            public static readonly int ServerPort = 8250;
            public static readonly int RequestTimeout = 120;
        }
    }
}
